package cs236369.hw5;

import java.io.IOException;
import java.util.Properties;

import cs236369.hw5.util.ResourceLoader;

public class Hw5Conf
{
	private final static String PATH = "hw5.properties";
	private final static String ADMIN_PASS_KEY = "cs236369.hw5.adminPassword";
	
	protected final static String ERR_MSG = "was not able to initialize the properties";
	
	private static String adminPass = null;
	

	/**
	 * this method will load the yellow pages configuration from file
	 * 
	 * @throws IOException when properties can't be load, or file doesn't exists
	 */
	public static void initialize() throws IOException
	{
		try
		{
			Properties p = new Properties();
			p.load(ResourceLoader.getResourceAsStream(PATH));
			adminPass = p.getProperty(ADMIN_PASS_KEY);
			
		}
		catch (IOException e)
		{
			throw new IOException(ERR_MSG, e);
		}
	}


	public static String getAdminPass()
    {
	    return adminPass;
    }

}
